import java.util.Scanner;

public class test1 {
    /*买飞机票
    需求:
    1.机票价格按照淡季旺季、头等舱和经济舱收费、输入机票原价、月份和头等舱或经济舱
    2.按照如下规则计算机票价格:旺季(5-10月)头等舱9折,经济舱8.5折,单机(11月到来奶呢4月)头等舱7折,经济舱6.5折
     */

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        System.out.println("请输入机票原价:头等舱/经济舱");
        int a = sc.nextInt();
        int b = sc.nextInt();
        System.out.println("头等舱价格为:"+a+"   "+"经济舱价格为:"+b);

        System.out.println("请输入需要查询的月份:(1-12)");
        int month = sc.nextInt();

        System.out.println("请输入要查询的价位:(头等舱1/经济舱0)");
        double price = 0;
        int flag = sc.nextInt();
        switch (flag){
            case 1:
                if(month>=5&&month<=11){
                    price = a*0.9;
                    System.out.println("价格为:"+price);
                }else if(month>=1&&month<=4||month==12){
                    price = b*0.85;
                    System.out.println("价格为:"+price);
                }else {
                    System.out.println("输入错误!!");
                }
                break;
            case 0:
                if(month>=5&&month<=11){
                    price = a*0.7;
                    System.out.println("价格为:"+price);
                }else if(month>=1&&month<=4||month==12){
                    price = b*0.65;
                    System.out.println("价格为:"+price);
                }else {
                System.out.println("月份输入错误!!");
            }
                break;
            default:
                System.out.println("查询对象错误!");
                break;
        }
    }
}


